<template lang="jade">

div.user-center
	header
		i.iconfont.setting(@click="goSetUp()") &#xe62a;
		div.top-content
			div.protrait
				img(src="../../assets/images/user/protrait.jpg")
			div.value
				b 您好 {{info.phone}}
				strong {{info.total}}
				em 总资产(元)
			ul.cbox.nav
				li
					b 8,145,275.00
					span 昨天收益(元)
				li
					b 8,145,275.00
					span 累计总收益(元)
	div.btnlist
		a.p_btn(v-link="{ path: '/withdraw-cash'}") 提现
		a.m_btn(v-link="{ path: '/recharge'}") 充值

	ul.moneylist.clearfix
		li
			strong 可用余额(元)
			span {{info.balance}}
		li
			strong 待收总额(元)
			span {{info.total_collect}}
		li
			strong 待收本金(元)
			span 55,528.00
		li
			strong 本月待收(元)
			span 45,528.00
		li
			strong 推荐收益(元)
			span 25,528.00
		li
			strong 冻结资金(元)
			span 15,528.00

	ul.s-menu.bottom
		li(v-link="{ path: '/openAccount'}")
			i.iconfont.ft &#xe63b;
			开通账号
			i.iconfont.se &#xe600;
		li(v-link="{ path: '/friends-report'}")
			i.iconfont.ft &#xe63b;
			推荐/邀请好友数据总览
			i.iconfont.se &#xe600;
		li(v-link="{ path: '/friends-list'}")
			i.iconfont.ft &#xe63a;
			好友列表
			i.iconfont.se &#xe600;

		li(v-link="{ path: '/auto-buy'}")
			i.iconfont.ft &#xe633;
			自动投标
			i.iconfont.se &#xe600;

		li(v-link="{ path: '/invest'}")
			i.iconfont.ft &#xe62c;
			投资明细
			i.iconfont.se &#xe600;

		li(v-link="{ path: '/money-record'}")
			i.iconfont.ft &#xe636;
			充值/提现记录
			i.iconfont.se &#xe600;

		li(v-link="{ path: '/message'}")
			i.iconfont.ft &#xe630;
			站内信息 
			i.iconfont.se &#xe600;

</template>

<script>
import {Api_User_Info} from '../../config/api'

export default {

  data () {
    return {
    	info:{}
    }
  },
  created(){
  	this.fetch();
  },
  methods: {
    fetch: function () {
      this.$http({url: Api_User_Info, method: 'GET'}).then(function (response) {
        var obj = response.data;
        this.info = obj.data


        if( obj.status == true )
          this.invit_status = this.info.invit_status

        if(obj.code == '10019'){
          sessionStorage.removeItem("login"); 
          this.$route.router.go('/login?from=user')
        }

      }, function (response) {
          console.log(response)
      });
    },

    setMenu: function (next) {
      this.showMenu = !this.showMenu
    },

    goSetUp: function (next) {
      this.$route.router.go('/user-setup?tel='+this.info.phone+'&name='+this.info.bank_AcName+'&acno='+this.info.bank_AcNo)
      //this.$route.router.go('/user-setup');
    }

  }
}
</script>
